<?php
/**
 * https://gitee.com/litephp/LiteSkeleton
 * User: jayfun
 * Date: 2019/9/13
 * Time: 12:25
 */

namespace Jayfun\Skeleton;

use Pimple\Container;

class Application extends Container
{

    protected $providers;

    public function __construct(array $values = array())
    {
        parent::__construct($values);
        $this->registerProviders();
    }

    public function __set($id, $value)
    {
        return $this->offsetSet($id, $value);
    }

    public function __get($id)
    {
        return $this->offsetGet($id);
    }

    public function registerProviders()
    {
        foreach ($this->providers as $provider){
            $this->register(new $provider);
        }
    }
}